//
//  BYCountTextField.h
//  OCDemo
//
//  Created by zhumuzhi on 2022/2/16.
//

#import "BYTextField.h"


NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM (NSUInteger, BYCountTextFieldChangeType) {
    BYCountTextFieldChangeTypeAdd = 1,
    BYCountTextFieldChangeTypeSub,
    BYCountTextFieldChangeTypeNone,
};

typedef void(^BYCountBlock)(NSInteger count, BYCountTextFieldChangeType changeType);

@interface BYCountTextField : UIView

@property (nonatomic, strong) UIButton     *leftButton;

@property (nonatomic, strong) BYTextField  *textField;

@property (nonatomic, strong) UIButton     *rightButton;

/**
 最大值
 */
@property (nonatomic , assign) NSInteger   maxCount;

/**
 最小值
 */
@property (nonatomic , assign) NSInteger   minCount;

/**
 当前值
 */
@property (nonatomic , assign) NSInteger   count;

/**
 点击+ - 按钮，每次新增、减少数量，不传默认为：1
 */
@property (nonatomic , assign) NSInteger   editCount;

/**
 设置+ -按钮不置灰  YES：都不置灰   NO：走父类置灰逻辑，默认为NO
 */
@property (nonatomic, assign) BOOL         addSubButtonEdit;

/**
 CountBlock
 */
@property (nonatomic , copy) BYCountBlock countBlock;

@end

NS_ASSUME_NONNULL_END
